#ifndef __INFLATION_LAYER_H__
#define __INFLATION_LAYER_H__

#include "../common/costmap_base.h"

namespace costmap_2d{

class InflationLayer{
    public:
        InflationLayer(boost::shared_ptr<Costmap> realtime_costmap_ptr, double inflation_radius);
        ~InflationLayer();
        // 计算缓存数据
        void calCacheDate();

        // 更新代价地图
        void updateCostmap(std::unordered_map<int, GridCell>& obstacle_cells);
        // 清空代价地图
        void clearCostmap();

    private:
        double inflationRadius_;    //膨胀半径
        int inflationRadiusPixels_;
        boost::shared_ptr<Costmap> realtimeCostmapPtr_;   //实时代价地图
        std::map<double, std::vector<GridCell>> inflation_cells_;  
        vector<vector<double>> costCache_;
        vector<vector<double>> distanceCache_;
};

}; //costmap_2d

#endif